Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HCRC-97 | feat: image and image gallery modules #183

Merged
merged 19 commits into from
Jul 7, 2024
Merged

HCRC-97 | feat: image and image gallery modules #183

merged 19 commits into from
Jul 7, 2024

Conversation

melniiv
Copy link
Contributor

@melniiv melniiv commented Jul 2, 2024

Description

image image

Issues

Closes

DEV-XXX:

Related

Testing

Automated tests

Manual testing

Screenshots

Additional notes

@nikomakela
Copy link
Contributor

Tested with Pixel phone in Storybook
image

src/core/imageGallery/ImageGallery.tsx Outdated Show resolved Hide resolved
src/core/imageGallery/ImageGallery.tsx Outdated Show resolved Hide resolved
src/core/imageGallery/ImageGallery.tsx Outdated Show resolved Hide resolved
@melniiv melniiv requested a review from nikomakela July 4, 2024 05:49
Copy link
Contributor

@nikomakela nikomakela left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Pixel Phone view for Lightbox now fully fits to the screen, but it is quite useless like this
image

I think it is too small also for example for the iPad:
image

Sure the app can totally disable the light box on handhelds, but iPad for example should have quite high resolution, so I think it would be better like how it was earlier, so that it takes the full screen, but just so that it all fits to the screen.

I also added quite many code quality related comments. I just feel that they would make the code easier to understand and maintain, since there is quite much code needed for the features. The component does what it should and it now works, but I would just improve the code readability and reusability a bit.

Anyway, good work so far!

src/core/imageGallery/Lightbox.tsx Outdated Show resolved Hide resolved
src/core/imageGallery/Lightbox.tsx Outdated Show resolved Hide resolved
src/core/imageGallery/Lightbox.tsx Outdated Show resolved Hide resolved
src/core/imageGallery/Lightbox.tsx Outdated Show resolved Hide resolved
Comment on lines 128 to 158
<div className={styles.actionsWrapper}>
<Button
iconLeft={<IconAngleLeft />}
onClick={onPreviousClick}
theme="black"
variant="secondary"
>
<span className={styles.screenReaderText}>{previous}</span>
</Button>
<Button
iconLeft={<IconAngleRight />}
onClick={onNextClick}
theme="black"
variant="secondary"
>
<span className={styles.screenReaderText}>{next}</span>
</Button>
</div>
<button
className={styles.closeButton}
id={`close-${lightboxUid}`}
type="button"
aria-controls={lightboxUid.toString()}
aria-expanded="true"
onClick={onClick}
>
<span className={styles.screenReaderText}>
{closeButtonLabelText}
</span>
<svg viewBox="0 0 24 24" aria-hidden="true" tabIndex={-1} />
</button>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would self use some compound component pattern for these, since the component is becoming quite big. Just something to think about.

Suggested change
<div className={styles.actionsWrapper}>
<Button
iconLeft={<IconAngleLeft />}
onClick={onPreviousClick}
theme="black"
variant="secondary"
>
<span className={styles.screenReaderText}>{previous}</span>
</Button>
<Button
iconLeft={<IconAngleRight />}
onClick={onNextClick}
theme="black"
variant="secondary"
>
<span className={styles.screenReaderText}>{next}</span>
</Button>
</div>
<button
className={styles.closeButton}
id={`close-${lightboxUid}`}
type="button"
aria-controls={lightboxUid.toString()}
aria-expanded="true"
onClick={onClick}
>
<span className={styles.screenReaderText}>
{closeButtonLabelText}
</span>
<svg viewBox="0 0 24 24" aria-hidden="true" tabIndex={-1} />
</button>
<Lightbox.Actions/>
<Lightbox.CloseButton/>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

src/core/imageGallery/Lightbox.tsx Outdated Show resolved Hide resolved
src/core/imageGallery/ImageGallery.tsx Outdated Show resolved Hide resolved
src/core/imageGallery/ImageGallery.tsx Outdated Show resolved Hide resolved
src/core/imageGallery/ImageGallery.tsx Outdated Show resolved Hide resolved
src/core/imageGallery/ImageGallery.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@nikomakela nikomakela left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, after refactoring with context, this looks so much better to my eye! Good job! 👏
I'll test this still, soonish...

src/core/imageGallery/Lightbox.tsx Outdated Show resolved Hide resolved
@melniiv melniiv merged commit 6e92ddb into main Jul 7, 2024
1 check passed
@melniiv melniiv deleted the image-module branch July 7, 2024 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants